package nc.lfw.finance.adapter;

import nc.lfw.core.comp.LeftToRightComp;
import nc.lfw.core.tags.LeftToRightCompTag;

public class WebbxLeftToRightCompTag extends LeftToRightCompTag {
	public String generateHeadScript() {
		//ListToListComp(parent, name, left, top, width, height, position, leftLabelName, rightLabelName)
		StringBuffer buf = new StringBuffer();
		LeftToRightComp ltol = (LeftToRightComp) getComponent();
		buf.append("window.")
		   .append(COMP_PRE)
		   .append(ltol.getId())
		   .append(" = new WebbxListToListComp(document.getElementById('")
		   .append(DIV_PRE)
		   .append(getId())
		   .append("'),'")
		   .append(ltol.getId())
		   .append("','0','0','")
		   .append(ltol.getWidth())
		   .append("','")
		   .append(ltol.getHeight())
		   .append("','")
		   .append(ltol.getPosition())
		   .append("','")
		   .append(ltol.getLeftLabelName() ==  null ? "" : ltol.getLeftLabelName())
		   .append("','")
		   .append(ltol.getRightLabelName() == null ? "" : ltol.getRightLabelName())
		   .append("',")
		   .append(ltol.isWithAll())
		   .append(");\n");
		return buf.toString();
		
	}
}
